package org.leo.dm.common.exception;

/**
 * 
 * Created on 2015年11月25日
 * <p>
 * Description 自定义异常
 * <p>
 * Copyright neusoft (c) 2015 .
 * 
 * @author xiao_h
 *
 */
public class DpException extends Exception {

	private static final long serialVersionUID = -1167969329653748230L;
	private DpErrorBean errorBean;

	@Override
	public String toString() {
		return "BusinessException " + errorBean.toString();
	}

	private String getError() {
		return errorBean.toString();
	}

	public DpException(DpExceptionCodeEnum exceptionCodeEnum, String errorMsg) {
		super();
		errorBean = new DpErrorBean(exceptionCodeEnum.getCode(), "详细" + exceptionCodeEnum.getMsg() + "： " + errorMsg);
	}

	@Override
	public String getMessage() {
		return getError();
	}

}
